package YZ.Students.Mier.Service.impl;

import YZ.Students.Mier.Dao.BaseDao;
import YZ.Students.Mier.Dao.InvitataionDao;
import YZ.Students.Mier.Dao.impl.InvitataionDaoImpl;
import YZ.Students.Mier.Service.IInvitataionService;
import YZ.Students.Mier.entity.InvitataionEntity;
import YZ.Students.Mier.vo.IndexDataVo;

import java.util.Date;
import java.util.List;

public class InvitataionServiceImpl extends BaseServiceImpl<InvitataionEntity> implements IInvitataionService {

    private InvitataionDao invitataionDao = new InvitataionDaoImpl();

    @Override
    protected BaseDao<InvitataionEntity> getBaseDao() {
        return invitataionDao;
    }

    @Override
    public List<IndexDataVo> indexDataList()  throws Exception {
        return invitataionDao.indexDataList();
    }

    @Override
    public boolean save(InvitataionEntity invitataionEntity) throws Exception {
        invitataionEntity.setStatus(1);
        invitataionEntity.setType(1);
        invitataionEntity.setCreateTime(new Date());
        invitataionEntity.setScore(0.1);
        invitataionEntity.setCommentCount(0);
        return super.save(invitataionEntity);
    }
}
